Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-45048: [C++][Parquet] Deprecate unused chunk_size parameter in parquet::arrow::FileWriter::NewRowGroup() #45049

Closed
wants to merge 3 commits into from

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Dec 17, 2024

Rationale for this change

Just noticed that the implementation doesn't use the parameter.

What changes are included in this PR?

Remove the parameter from AddRowGroup()

Are these changes tested?

Are there any user-facing changes?

The chunk_size parameter is now deprecated.

@kszucs kszucs requested a review from wgtmac as a code owner December 17, 2024 15:43
@kszucs kszucs changed the title Deprecate unused chunk_size parameter in parquet::arrow::FileWriter::NewRowGroup() GH-45048: [C++][Parquet] Deprecate unused chunk_size parameter in parquet::arrow::FileWriter::NewRowGroup() Dec 17, 2024
@apache apache deleted a comment from github-actions bot Dec 17, 2024
Copy link

⚠️ GitHub issue #45048 has been automatically assigned in GitHub to PR creator.

@kszucs kszucs force-pushed the parquet-new-row-group branch 2 times, most recently from 81c50e0 to 9234e16 Compare December 17, 2024 15:48
@kszucs kszucs requested a review from kou as a code owner December 17, 2024 15:57
Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoah! this seems unused since 2017! good catch!
The CI failures are unrelated but all of them should be fixed on main:
#44955
#44999
should be quickly fixed with a rebase :)

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Dec 17, 2024
@kszucs kszucs force-pushed the parquet-new-row-group branch from f287bc8 to 49bb54a Compare December 17, 2024 17:36
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Dec 17, 2024
@@ -590,7 +590,7 @@ gparquet_arrow_file_writer_new_row_group(GParquetArrowFileWriter *writer,
{
auto parquet_arrow_file_writer = gparquet_arrow_file_writer_get_raw(writer);
return garrow::check(error,
parquet_arrow_file_writer->NewRowGroup(chunk_size),
parquet_arrow_file_writer->NewRowGroup(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also remove the chunk_size parameter from this function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, do I need to deprecate it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to deprecate it. We can do it as a breaking change. Because this will not be used by many users. This is a method added in 18.0.0.

diff --git a/c_glib/parquet-glib/arrow-file-writer.cpp b/c_glib/parquet-glib/arrow-file-writer.cpp
index 2b8e2bdeac..82f86e823b 100644
--- a/c_glib/parquet-glib/arrow-file-writer.cpp
+++ b/c_glib/parquet-glib/arrow-file-writer.cpp
@@ -574,7 +574,6 @@ gparquet_arrow_file_writer_write_table(GParquetArrowFileWriter *writer,
 /**
  * gparquet_arrow_file_writer_new_row_group:
  * @writer: A #GParquetArrowFileWriter.
- * @chunk_size: The max number of rows in a row group.
  * @error: (nullable): Return location for a #GError or %NULL.
  *
  * Start a new row group.
@@ -585,7 +584,6 @@ gparquet_arrow_file_writer_write_table(GParquetArrowFileWriter *writer,
  */
 gboolean
 gparquet_arrow_file_writer_new_row_group(GParquetArrowFileWriter *writer,
-                                         gsize chunk_size,
                                          GError **error)
 {
   auto parquet_arrow_file_writer = gparquet_arrow_file_writer_get_raw(writer);
diff --git a/c_glib/parquet-glib/arrow-file-writer.h b/c_glib/parquet-glib/arrow-file-writer.h
index 2c82f7c1f8..b35cea1182 100644
--- a/c_glib/parquet-glib/arrow-file-writer.h
+++ b/c_glib/parquet-glib/arrow-file-writer.h
@@ -136,7 +136,6 @@ gparquet_arrow_file_writer_write_table(GParquetArrowFileWriter *writer,
 GPARQUET_AVAILABLE_IN_18_0
 gboolean
 gparquet_arrow_file_writer_new_row_group(GParquetArrowFileWriter *writer,
-                                         gsize chunk_size,
                                          GError **error);
 
 GPARQUET_AVAILABLE_IN_18_0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update c_glib/parquet-glib/arrow-file-writer.h?

BTW, could you use your fork not apache/arrow next time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh, sorry. That was accidental.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a new PR from my fork #45088
Closing this and removing the branch.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Dec 17, 2024
@@ -556,7 +556,7 @@ cdef extern from "parquet/arrow/writer.h" namespace "parquet::arrow" nogil:
const shared_ptr[ArrowWriterProperties]& arrow_properties)

CStatus WriteTable(const CTable& table, int64_t chunk_size)
CStatus NewRowGroup(int64_t chunk_size)
CStatus NewRowGroup()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can expose the deprecated method as well.

@github-actions github-actions bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Dec 18, 2024
@kszucs kszucs closed this Dec 20, 2024
@kszucs kszucs deleted the parquet-new-row-group branch December 20, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants